package com.ccs.lotterySystem.common.exception;

import com.ccs.lotterySystem.common.errorcode.ControllerErrorCodeConstants;
import com.ccs.lotterySystem.common.errorcode.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ControllerException extends RuntimeException {

    private  int code;
    private  String message;

    public ControllerException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ControllerException() {

    }

    public ControllerException(ErrorCode errorCode){
        this.code=errorCode.getCode();
        this.message= errorCode.getMessage();
    }
}
